<div class="order">
	<form id='frmAdminForm' method='post'>
		<!--  Thông tin đơn hàng -->
		<table>
			<caption>THÔNG TIN ĐƠN HÀNG</caption>
			<thead>
			<tr>
				<th>Mã hóa đơn</th>
				<th>Tên Khách Hàng</th>
				<th>Ngày đặt</th>
				<th>Nơi nhận</th>
				<th>Ghi chú</th>
				<th>Trạng thái xử lý</th>
			</tr>
			</thead>
			<tbody>
			<tr>
				<td><?php echo $this->orderInfo['order_code']?></td>
				<td>
					<?php echo $this->userInfo['user_email']?>
					
					<p>mobile: <?php echo $this->orderInfo['order_mobile']?></p>
				</td>
				<td>
				<?php
					$date = date_create($this->orderInfo['order_creation_time']);
					echo date_format($date, 'd/m/Y');
				?>
				</td>
				<td>
					<input type='text' value='<?php echo $this->orderInfo['order_address']?>' name='order_address'/>
				</td>
				<td>
					<textarea name='order_note'>
						<?php echo $this->orderInfo['order_note']?>
					</textarea>
				</td>
				<td>
					<?php 
						$arr = array(
								Application_Model_DbTable_Order::ORDER_NEW => 'Mới đặt hàng',
								Application_Model_DbTable_Order::ORDER_PROCESSING=>'Đang Chờ phản hồi',
								Application_Model_DbTable_Order::ORDER_PROCESSED=>'Đã xử lý'
						);
	
					?>
					<select name='order_status'>
						
						<?php 
							
							foreach($arr as $key => $value):
								$selected='';
								if($this->orderInfo['order_status'] == $key ){$selected='selected=selected';};
								echo '<option value="'.$key.'" '.$selected.'>'.$value.'</option>'; 
						 	endforeach;
						 ?>
					</select>
			
				</td>
			</tr>
			</tbody>
		</table>	
		<!-- Thông tin đơn hàng -->
	</form>
	
	
		<table class="order-detail-table">
		<caption>CHI TIẾT ĐƠN HÀNG</caption>
		<thead>
			<tr>
				<th>Tên sản phẩm</th>
				<th>Số lượng</th>
				<th>Đơn giá </th>
				<th>Thành tiền ( vnd )</th>			
			</tr>
		</thead>
		<tbody>
		<?php 
			$total = 0;
			foreach($this->orderdetail as $item):	
				$mdProduct = new Application_Model_DbTable_Product();
				$product = $mdProduct->find($item['order_detail_product_id'])->current();
					$price = $item['order_detail_product_quantity'] * $product['product_price'];
					$total += $price;
		?>
		<tr>
			<td>
				<?php echo $product['product_name']?>
			</td>
			<td>
				<?php echo $item['order_detail_product_quantity']?>
			</td>
			<td>
				<?php echo number_format($product['product_price']) ?>
			</td>
			<td>
				<?php echo number_format($price);?>
			</td>			
		</tr>
		<?php endforeach;?>
		<tr>
			<td colspan='4'>Tổng cộng: <?php echo number_format($total)?></td>
		</tr>
		</tbody>
	</table>
	
	
	
	
	
	
	
	<table >
		<caption>THÔNG TIN KHÁCH HÀNG</caption>
		<thead>
			<tr>
				<th>Tên khách hàng</th>
				<th>Email</th>
				<th>Điện thoại</th>
				<th>Địa chỉ</th>
				
			</tr>
		</thead>
		<tbody>
		<tr>
			<td><?php echo $this->userInfo['user_fullname']?></td>
			<td>
				<?php echo $this->userInfo['user_email']?>
			</td>
			<td>
				<?php echo $this->userInfo['user_phone']?>
			</td>
			<td><?php echo $this->userInfo['user_address']?></td>
			
		</tr>
		</tbody>
	</table>
	

</div>